package com.yupi.maker.cli.command;

import cn.hutool.core.io.FileUtil;
import picocli.CommandLine;

import java.io.File;
import java.util.List;

/**
 * @version 1.0
 * @Author moresuo
 * @Date 2024/9/9 16:58
 * @注释 文件列表命令
 */
@CommandLine.Command(name="list",mixinStandardHelpOptions = true)
public class ListCommand implements Runnable{

    @Override
    public void run() {
        String projectPath = System.getProperty("user.dir");
        //输入路径
        String inputPath=new File(projectPath,"yuzi-generator-demo-projects/acm-template").getAbsolutePath();
        List<File> files = FileUtil.loopFiles(inputPath);//递归获取文件
        files.forEach(file -> {
            System.out.println(file);
        });
    }
}
